<?php
class Session
{
    protected $_sessionName = 'click_session';

    public function __construct()
    {
        $this->_start();
    }

    protected function _start()
    {
        session_name($this->_sessionName);
        session_start();
    }

    public function get($name)
    {
        if ($this->isExist($name))
        {
            return $_SESSION[$name];
        }

        return false;
    }

    public function set($name, $value)
    {
        $_SESSION[$name] = $value;
    }

    public function isExist($name)
    {
        return isset($_SESSION[$name])? true : false;
    }

    public function remove($name)
    {
        unset($_SESSION[$name]);
    }

    public function destroy()
    {
        $_SERVER = array();

        setcookie(session_name(), '', time() - 42000);

        session_destroy();
    }
}